﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using MP.Core.Config;
using MP.Core.Library;
using MP.Core.Authentication;

using MP.LayerHelper.MP_OBS.BLL;
using MP.LayerHelper.MP_OBS.DAL.EntityClasses;
using MP.LayerHelper.MP_OBS.DAL.HelperClasses;

public partial class Member_Control_RoleDepart : MP.Core.Authentication.Control.AuthenBase
{
    public bool IsEditDepart = false;
    public bool IsAddRole = false;

    protected void Page_Load(object sender, EventArgs e)
    {
        loadPermission();
        loadData();
    }

    void loadData()
    {
        DataSet dst = MaDepartmentManager.CreateInstant().GetAllDepart();
        repDepart.DataSource = dst;
        repDepart.DataBind();
    }

    void loadPermission()
    {
        IsEditDepart = MPRoleProvider.CreateInstant().CheckRoles(Util.CurrentUserName, EnumModules.DEPART, EnumActions.EDIT);
        IsAddRole = MPRoleProvider.CreateInstant().CheckRoles(Util.CurrentUserName, EnumModules.SUB_ROLE, EnumActions.ADD);
    }
}
